<script>
// 顶部tab+页面切换
import { defineComponent } from 'vue'
export default defineComponent({
	name: 'WeworkQr'
})
</script>
<script setup>
import { ref } from 'vue'
import { toRaw } from '@vue/reactivity'
import base1 from './detail/base.vue'
import table1 from './detail/table.vue'
import chart from './detail/chart.vue'
import Detail1 from '@/pages/wework/customer/detail/index.vue'

const dialogVisible = ref(false)
const detail1 = ref(null)
const baseRef = ref(null)
const tableRef = ref(null)
const chartRef = ref(null)
const isShowDetail = ref(false)
const staffId = ref(0)
const show = (id)=>{
	staffId.value = id
	dialogVisible.value = true
	isShowDetail.value = false
	setTimeout(()=>{
		baseRef.value.show(id)
		tableRef.value.show(id)
		chartRef.value.show(id)
	},5)
}
const showDetail = (val)=>{
  console.log('客户详情')
  isShowDetail.value = true
	setTimeout(()=>{
		detail1.value.show(val)
	},5)
}
const emits = defineEmits(['goBack'])
defineExpose({
	show
})
</script>
<template>
	<div v-if="dialogVisible"> 
		<div v-if="!isShowDetail">
      <base1 ref="baseRef" />
			<chart ref="chartRef" />
      <table1 ref="tableRef" @showDetail="showDetail($event,val)" />
    </div>
    <Detail1 v-else ref="detail1" @diaUpdate="(val)=>show(staffId)" />
		
	</div>
</template>
<style lang="scss">
@import url('../../../style/app-component.scss');
.el-page-header {
  display:none;
}
</style>
